﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="VoucherCenter.aspx.cs" Inherits="User_VoucherCenter" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>充值中心</title>
    <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../ePioneer/javascript/jq_fn.js"></script>
    <link href="../ePioneer/css/main.css" rel="stylesheet" type="text/css" />
    <link href="../ePioneer/css/m_dp02.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .self_c_r
        {
            width: 690px;
            height: 400px;
            overflow: hidden;
            background: url(image/bg_self.jpg) right bottom no-repeat;
            margin-left: 100px;
            margin-top: 40px;
        }
        .self_c_r_c5
        {
            width: 400px;
            background: url(image/pic_self5.jpg) 50px 40px no-repeat;
            padding-top: 30px;
            padding-left: 140px;
        }
    </style>
</head>
<body style="border-style: none" scroll="no" topmargin="0" leftmargin="0">
    <div class="dp_m">
        <div class="dp_top">
        </div>
        <div class="cnt">
            <script src="js/header.js" type="text/javascript"></script>
            <div class="self_c_r">
                <div class="self_c_r_c5">
                    <table id="tbpc">
                        <tr>
                            <td align="left" height="40">
                                盯盘先锋网上充值
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: right;">
                                <select id="selectLoginType">
                                    <option value="3">手机号</option>
                                    <option value="2">邮箱</option>
                                    <option value="4">益盟号</option>
                                    <option value="1">昵称</option>
                                </select>：
                            </td>
                            <td>
                                <input id="txt_LoginName" type="text" maxlength="50" name="txtFeil" />
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: right;">
                                密码：
                            </td>
                            <td valign="top">
                                <input id="txt_PassWord" type="text" maxlength="16" name="txtFeil" />
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: right;">
                                充值卡卡号：
                            </td>
                            <td valign="top">
                                <input id="txt_CardID" type="text" maxlength="10" name="txtFeil" />
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: right;">
                                充值卡密码：
                            </td>
                            <td valign="top">
                                <input id="txt_CardPassWord" type="text" maxlength="6" name="txtFeil" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <input style="border-bottom: medium none; border-left: medium none; border-top: medium none;
                                    border-right: medium none" value=" 确 定 " type="button" onclick="return Voucher();" />
                                <input style="border-bottom: medium none; border-left: medium none; border-top: medium none;
                                    border-right: medium none" value=" 重 填 " type="reset" onclick="return ResetTxt();" />
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <div class="dp_bottom">
            <img src="../ePioneer/images/dpm_bg4.gif" width="794" height="9" /></div>
    </div>
    <script type="text/jscript">
        //重填
        function ResetTxt() {
            $("input[name=txtFeil]").val("");
        }
        //获取验证码
        function Voucher() {
            var loginName = $.trim($("#txt_LoginName").val());
            var passWord = $.trim($("#txt_PassWord").val());
            var loginType = $.trim($("#selectLoginType").val());
            var cardId = $.trim($("#txt_CardID").val());
            var cardPassWord = $.trim($("#txt_CardPassWord").val());
            var testMobile = new RegExp("^0{0,1}(13[0-9]|15[0-9]|180|147|182|18[4-9])[0-9]{8}$");
            var testEmail = new RegExp("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
            if (loginName == "") {
                alert("用户名不能为空");
                return false;
            }
            if (loginType == "3" && !testMobile.test(loginName)) {
                alert("手机号码不正确");
                return false;
            }
            if (loginType == "2" && !testEmail.test(loginName)) {
                alert("邮箱不正确");
                return false;
            }
            if (passWord == "") {
                alert("密码不能为空");
                return false;
            }
            if (cardId == "") {
                alert("充值卡卡号不能为空");
                return false;
            }
            if (cardPassWord == "") {
                alert("充值卡密码不能为空");
                return false;
            }
            $.ajax({
                type: "POST",
                url: "../UpdateUserInfo.ashx",
                dataType: "json",
                data: { action: "Voucher", loginName: loginName, passWord: passWord, loginType: loginType, cardId: cardId, cardPassWord: cardPassWord },
                success: function (result) {
                    if (result[0] == '0') {
                        alert(result[1]);
                    }
                    else {
                        alert(result[1]);
                        return false;
                    }
                }
            });
        }

    </script>
</body>
</html>
